package com.neuedu.projectedu.controller;

import com.neuedu.projectedu.entity.User;
import com.neuedu.projectedu.properties.PayConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class IndexController {
    @Autowired
    private PayConfig payConfig;

    @Value("${com.neuedu.name}")
    private String name;

    @Value("${com.neuedu.test2}")
    private Integer test2;

    @GetMapping("index")
    public User index(){
        User user=new User();
        user.setId(123L);
        user.setUsername(name);
//        user.setPassword("123456");
        return user;
    }

    @GetMapping("/pay")
    public PayConfig getPay(){
        log.info(test2.toString());
        return payConfig;
    }
}
